package com.stormrage.entity.edu.rep;

import java.io.Serializable;
import java.util.List;

import com.stormrage.entity.learn.rep.LeaCourseStudyRep;

public class EduModuleRep implements Serializable {

	// ------------------------------- Fields -------------------------------

	private static final long serialVersionUID = 6533904881516164953L;

	// ------------------------------- Fields -------------------------------

	private Integer seq;

	private Integer id;

	private String module;

	private Integer ness;

	private String nessStr;

	private List<LeaCourseStudyRep> course;

	// ------------------------------- Fields -------------------------------

	public EduModuleRep() {
	}

	// ------------------------------- Fields -------------------------------

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getModule() {
		return module;
	}

	public void setModule(String module) {
		this.module = module;
	}

	public Integer getNess() {
		return ness;
	}

	public void setNess(Integer ness) {
		this.ness = ness;
	}

	public String getNessStr() {
		return nessStr;
	}

	public void setNessStr(String nessStr) {
		this.nessStr = nessStr;
	}

	public List<LeaCourseStudyRep> getCourse() {
		return course;
	}

	public void setCourse(List<LeaCourseStudyRep> course) {
		this.course = course;
	}

	// ------------------------------- Fields -------------------------------

	public static EduModuleRep instance(EduModuleRep entity, Integer seq, List<LeaCourseStudyRep> course) {
		entity.setSeq(seq);
		entity.setModule(entity.getModule());
		if (null == entity.getNess())
			entity.setNessStr("无");
		if (null != entity.getNess() && entity.getNess().equals(0))
			entity.setNessStr("必修");
		if (null != entity.getNess() && entity.getNess().equals(1))
			entity.setNessStr("选修");
		entity.setCourse(course);
		return entity;
	}

	@Override
	public String toString() {
		return this.getClass() + " : seq - " + seq + " id - " + id + " module - " + module + " ness - " + ness
				+ " nessStr - " + nessStr + " course - " + course;
	}

}
